﻿/// <reference path="../../Scripts/jasmine/jasmine.js" />
/// <reference path="../../SpriteViewer/Scripts/Dev4U.SP.UI.SpriteViewer.js" />

(function () {
    describe('methods', function () {
        it('getSettings', function () {
            expect(Dev4U.SP.UI.SpriteViewer.getSettings('formatmap16x16', 2010)).not.toBeNull();
            expect(Dev4U.SP.UI.SpriteViewer.getSettings('formatmap16x16', 2013)).not.toBeNull();

            expect(Dev4U.SP.UI.SpriteViewer.getSettings('formatmap32x32', 2010)).not.toBeNull();
            expect(Dev4U.SP.UI.SpriteViewer.getSettings('formatmap32x32', 2013)).not.toBeNull();

            expect(Dev4U.SP.UI.SpriteViewer.getSettings('ewais', 2010)).not.toBeNull();
            expect(Dev4U.SP.UI.SpriteViewer.getSettings('ewais', 2013)).not.toBeNull();
        });
        it('mappings.getByCoords', function () {
            var id = 'Ribbon.BDCAdmin.ApplicationManagement.ExportModel';

            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('formatmap16x16', 2010, -160, -96).id).toEqual(id);
            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('formatmap16x16', 2013, -145, -235).id).toEqual(id);
            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('formatmap32x32', 2010, -320, -320).id).toEqual(id);
            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('formatmap32x32', 2013, -307, -307).id).toEqual(id);

            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('', 2010, 1, 1)).toBeNull();
            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('formatmap16x16', 0, 1, 1)).toBeNull();
            expect(Dev4U.SP.UI.SpriteViewer.mappings.getByCoords('formatmap16x16', 2010, 0, 0)).toBeNull();
        });
        it('mappings.getById', function () {
            var id = 'Ribbon.BDCAdmin.ApplicationManagement.ExportModel';

            expect(Dev4U.SP.UI.SpriteViewer.mappings.getById('formatmap16x16', id).id).toEqual(id);
            expect(Dev4U.SP.UI.SpriteViewer.mappings.getById('formatmap32x32', id).id).toEqual(id);
        });
    });
})();